#ifndef TCPCLIENT_H
#define TCPCLIENT_H

#include <QWidget>
#include <QFile>
#include <QTcpSocket>
#include "protool.h"
#include "opewidget.h"




namespace Ui {
class TcpClient;
}

class TcpClient : public QWidget
{
    Q_OBJECT

public:
    explicit TcpClient(QWidget *parent = 0);
    ~TcpClient();
    void loadConfig();//函数声明

    static TcpClient &getInstance();//单例模式
    QTcpSocket &getTcpSocket();
    QString loginName();//获得登录的名字
    QString curPath();
    void setCurPath(QString strCurPath);
    



private:
    Ui::TcpClient *ui;
    QString m_strIP;
    quint16 m_usPort;
    //链接服务器，和服务器进行数据交互
    QTcpSocket m_tcpSocket;
    QString m_strLoginName;//登陆的用户名
    QString m_strCurPath;
    QFile m_file;

public slots:
    void showConnect();
    void revcMsg();
private slots:
    //void on_send_pb_clicked();
    void on_login_pb_clicked();
    void on_regist_pb_clicked();
    void on_cancel_pb_clicked();
};
#endif // TCPCLIENT_H

